package com.augurit.gzcgwsp.wfex.bi.convert;

import com.augurit.gzcgwsp.wfex.bi.web.form.WfTemplateAttachmentRefFormEX;
import com.augurit.gzcgwsp.wfex.common.entity.WfTemplateAttachmentRefEX;
import com.augurit.wf.bi.web.form.WfTemplateAttachmentRefForm;
import com.augurit.wf.common.entity.WfTemplateAttachmentRef;

public class WfTemplateAttachmentRefConvertorEX {
    public static WfTemplateAttachmentRefEX convertFormToVo(WfTemplateAttachmentRefFormEX form, WfTemplateAttachmentRefEX entity){
        if(form != null){
            if(form.getId() != null)
                entity.setId(form.getId());
            if(form.getTemplateId() != null)
                entity.setTemplateId(form.getTemplateId());
            if(form.getFileCode() != null && form.getFileCode().trim().length() > 0)
                entity.setFileCode(form.getFileCode());
            if(form.getFilePath() != null && form.getFilePath().trim().length() > 0)
                entity.setFilePath(form.getFilePath());
            if(form.getFileName() != null && form.getFileName().trim().length() > 0)
                entity.setFileName(form.getFileName());
            if(form.getFileType() != null && form.getFileType().trim().length() > 0)
                entity.setFileType(form.getFileType());
            if(form.getCreator() != null && form.getCreator().trim().length() > 0)
                entity.setCreator(form.getCreator());
            if(form.getCreateTime() != null)entity.setCreateTime(form.getCreateTime());
            if(form.getUpdator() != null && form.getUpdator().trim().length() > 0)
                entity.setUpdator(form.getUpdator());
            if(form.getUpdateTime() != null)
                entity.setUpdateTime(form.getUpdateTime());
            if(form.getMemo() != null && form.getMemo().trim().length() > 0)
                entity.setMemo(form.getMemo());
            if(form.getFileRealName() != null && form.getFileRealName().trim().length() > 0)
                entity.setFileRealName(form.getFileRealName());
            if(form.getFileFormat() != null && form.getFileFormat().trim().length() > 0){
                entity.setFileFormat(form.getFileFormat());
            }
        }
        return entity;
    }
	
	public static WfTemplateAttachmentRefFormEX convertVoToForm(WfTemplateAttachmentRefEX entity){
		WfTemplateAttachmentRefFormEX form = new WfTemplateAttachmentRefFormEX();
		
		if(entity != null){
			form = new WfTemplateAttachmentRefFormEX();
			form.setId(entity.getId());
			form.setTemplateId(entity.getTemplateId());
			form.setFileCode(entity.getFileCode());
			form.setFilePath(entity.getFilePath());
			form.setFileName(entity.getFileName());
			form.setCreator(entity.getCreator());
			form.setCreateTime(entity.getCreateTime());
			form.setUpdator(entity.getUpdator());
			form.setUpdateTime(entity.getUpdateTime());
			form.setMemo(entity.getMemo());
			form.setFileFormat(entity.getFileFormat());
			form.setFileType(entity.getFileType());
			form.setFileRealName(entity.getFileRealName());
		}
		return form;
	}
	
}
